﻿using System.Linq;
using BlueCrest.ConfigManagement.Storage.DB.Data;
using BlueCrest.ConfigManagement.Storage.DB.Service;
using NHibernate.Linq;
using NUnit.Framework;

namespace BlueCrest.ConfigManagement.ORM.NHibernate.Tests.Data
{
    [TestFixture]
    public class ConfigPathFlatEntityTests
    {
        private INHibernateSessionFactory _nHibernateSessionFactory;

        [SetUp]
        public void SetUp()
        {
            _nHibernateSessionFactory = new NHibernateSessionFactory();
        }

        [Test]
        public void CanReadScopeEntity()
        {
            using (var session = _nHibernateSessionFactory.CreateSessionFactory().OpenSession())
            {
                var items = session.Query<ConfigPathFlatEntity>().ToList();

                Assert.IsNotEmpty(items);
            }
        }
    }
}
